home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / Drag.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  27.4 KB  |  723 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        Drag.h
  3.  
  4.      Contains:    Drag and Drop Interfaces.
  5.  
  6.      Version:    Technology:    Mac OS 9
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1992-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __DRAG__
  18. #define __DRAG__
  19.  
  20. #ifndef __MACTYPES__
  21.     #include <MacTypes.h>
  22. #endif
  23.  
  24. #ifndef __EVENTS__
  25.     #include <Events.h>
  26. #endif
  27.  
  28. #ifndef __FILES__
  29.     #include <Files.h>
  30. #endif
  31.  
  32. #ifndef __APPLEEVENTS__
  33.     #include <AppleEvents.h>
  34. #endif
  35.  
  36. #ifndef __QUICKDRAW__
  37.     #include <Quickdraw.h>
  38. #endif
  39.  
  40.  
  41.  
  42.  
  43. #if PRAGMA_ONCE
  44. #pragma once
  45. #endif
  46.  
  47. #ifdef __cplusplus
  48. extern "C" {
  49. #endif
  50.  
  51. #if PRAGMA_IMPORT
  52. #pragma import on
  53. #endif
  54.  
  55. #if PRAGMA_STRUCT_ALIGN
  56.     #pragma options align=mac68k
  57. #elif PRAGMA_STRUCT_PACKPUSH
  58.     #pragma pack(push, 2)
  59. #elif PRAGMA_STRUCT_PACK
  60.     #pragma pack(2)
  61. #endif
  62.  
  63. /*
  64.   _________________________________________________________________________________________________________
  65.       
  66.    o DRAG MANAGER DATA TYPES
  67.   _________________________________________________________________________________________________________
  68. */
  69.  
  70. typedef struct OpaqueDragRef*             DragRef;
  71. typedef UInt32                             DragItemRef;
  72. typedef OSType                             FlavorType;
  73. /*
  74.   _________________________________________________________________________________________________________
  75.       
  76.    o DRAG ATTRIBUTES
  77.   _________________________________________________________________________________________________________
  78. */
  79.  
  80. typedef UInt32 DragAttributes;
  81. enum {
  82.     kDragHasLeftSenderWindow    = (1L << 0),                    /* drag has left the source window since TrackDrag*/
  83.     kDragInsideSenderApplication = (1L << 1),                    /* drag is occurring within the sender application*/
  84.     kDragInsideSenderWindow        = (1L << 2)                        /* drag is occurring within the sender window*/
  85. };
  86.  
  87. /*
  88.   _________________________________________________________________________________________________________
  89.       
  90.    o DRAG BEHAVIORS
  91.   _________________________________________________________________________________________________________
  92. */
  93.  
  94. typedef UInt32 DragBehaviors;
  95. enum {
  96.     kDragBehaviorNone            = 0,
  97.     kDragBehaviorZoomBackAnimation = (1L << 0)                    /* do zoomback animation for failed drags (normally enabled).*/
  98. };
  99.  
  100. /*
  101.   _________________________________________________________________________________________________________
  102.       
  103.    o DRAG IMAGE FLAGS
  104.   _________________________________________________________________________________________________________
  105. */
  106.  
  107. typedef UInt32 DragImageFlags;
  108. enum {
  109.     kDragRegionAndImage            = (1L << 4)                        /* drag region and image*/
  110. };
  111.  
  112. /*
  113.   _________________________________________________________________________________________________________
  114.       
  115.    o DRAG IMAGE TRANSLUCENCY LEVELS
  116.   _________________________________________________________________________________________________________
  117. */
  118.  
  119. enum {
  120.     kDragStandardTranslucency    = 0L,                            /* 65% image translucency (standard)*/
  121.     kDragDarkTranslucency        = 1L,                            /* 50% image translucency*/
  122.     kDragDarkerTranslucency        = 2L,                            /* 25% image translucency*/
  123.     kDragOpaqueTranslucency        = 3L                            /* 0% image translucency (opaque)*/
  124. };
  125.  
  126. /*
  127.   _________________________________________________________________________________________________________
  128.       
  129.    o DRAG DRAWING PROCEDURE MESSAGES
  130.   _________________________________________________________________________________________________________
  131. */
  132.  
  133.  
  134. typedef SInt16 DragRegionMessage;
  135. enum {
  136.     kDragRegionBegin            = 1,                            /* initialize drawing*/
  137.     kDragRegionDraw                = 2,                            /* draw drag feedback*/
  138.     kDragRegionHide                = 3,                            /* hide drag feedback*/
  139.     kDragRegionIdle                = 4,                            /* drag feedback idle time*/
  140.     kDragRegionEnd                = 5                                /* end of drawing*/
  141. };
  142.  
  143. /*
  144.   _________________________________________________________________________________________________________
  145.       
  146.    o ZOOM ACCELERATION
  147.   _________________________________________________________________________________________________________
  148. */
  149.  
  150.  
  151. typedef SInt16 ZoomAcceleration;
  152. enum {
  153.     kZoomNoAcceleration            = 0,                            /* use linear interpolation*/
  154.     kZoomAccelerate                = 1,                            /* ramp up step size*/
  155.     kZoomDecelerate                = 2                                /* ramp down step size*/
  156. };
  157.  
  158. /*
  159.   _________________________________________________________________________________________________________
  160.       
  161.    o FLAVOR FLAGS
  162.   _________________________________________________________________________________________________________
  163. */
  164.  
  165.  
  166. typedef UInt32 FlavorFlags;
  167. enum {
  168.     flavorSenderOnly            = (1 << 0),                        /* flavor is available to sender only*/
  169.     flavorSenderTranslated        = (1 << 1),                        /* flavor is translated by sender*/
  170.     flavorNotSaved                = (1 << 2),                        /* flavor should not be saved*/
  171.     flavorSystemTranslated        = (1 << 8)                        /* flavor is translated by system*/
  172. };
  173.  
  174. /*
  175.   _________________________________________________________________________________________________________
  176.       
  177.    o SPECIAL FLAVORS
  178.   _________________________________________________________________________________________________________
  179. */
  180.  
  181. enum {
  182.     flavorTypeHFS                = FOUR_CHAR_CODE('hfs '),        /* flavor type for HFS data*/
  183.     flavorTypePromiseHFS        = FOUR_CHAR_CODE('phfs'),        /* flavor type for promised HFS data*/
  184.     flavorTypeDirectory            = FOUR_CHAR_CODE('diry')        /* flavor type for AOCE directories*/
  185. };
  186.  
  187. /*
  188.   _________________________________________________________________________________________________________
  189.       
  190.    o FLAVORS FOR FINDER 8.0 AND LATER
  191.   _________________________________________________________________________________________________________
  192. */
  193.  
  194. enum {
  195.     kFlavorTypeClippingName        = FOUR_CHAR_CODE('clnm'),        /* name hint for clipping file (preferred over 'clfn')*/
  196.     kFlavorTypeClippingFilename    = FOUR_CHAR_CODE('clfn'),        /* name for clipping file*/
  197.     kFlavorTypeDragToTrashOnly    = FOUR_CHAR_CODE('fdtt'),        /* for apps that want to allow dragging private data to the trash*/
  198.     kFlavorTypeFinderNoTrackingBehavior = FOUR_CHAR_CODE('fntb') /* Finder completely ignores any drag containing this flavor*/
  199. };
  200.  
  201. /*
  202.   _________________________________________________________________________________________________________
  203.       
  204.    o DRAG TRACKING HANDLER MESSAGES
  205.   _________________________________________________________________________________________________________
  206. */
  207.  
  208.  
  209. typedef SInt16 DragTrackingMessage;
  210. enum {
  211.     kDragTrackingEnterHandler    = 1,                            /* drag has entered handler*/
  212.     kDragTrackingEnterWindow    = 2,                            /* drag has entered window*/
  213.     kDragTrackingInWindow        = 3,                            /* drag is moving within window*/
  214.     kDragTrackingLeaveWindow    = 4,                            /* drag has exited window*/
  215.     kDragTrackingLeaveHandler    = 5                                /* drag has exited handler*/
  216. };
  217.  
  218. /*
  219.   _________________________________________________________________________________________________________
  220.       
  221.    o HFS FLAVORS
  222.   _________________________________________________________________________________________________________
  223. */
  224.  
  225.  
  226. struct HFSFlavor {
  227.     OSType                             fileType;                    /* file type */
  228.     OSType                             fileCreator;                /* file creator */
  229.     UInt16                             fdFlags;                    /* Finder flags */
  230.     FSSpec                             fileSpec;                    /* file system specification */
  231. };
  232. typedef struct HFSFlavor                HFSFlavor;
  233.  
  234. struct PromiseHFSFlavor {
  235.     OSType                             fileType;                    /* file type */
  236.     OSType                             fileCreator;                /* file creator */
  237.     UInt16                             fdFlags;                    /* Finder flags */
  238.     FlavorType                         promisedFlavor;                /* promised flavor containing an FSSpec */
  239. };
  240. typedef struct PromiseHFSFlavor            PromiseHFSFlavor;
  241. /*
  242.   _________________________________________________________________________________________________________
  243.       
  244.    o APPLICATION-DEFINED DRAG HANDLER ROUTINES
  245.   _________________________________________________________________________________________________________
  246. */
  247. typedef CALLBACK_API( OSErr , DragTrackingHandlerProcPtr )(DragTrackingMessage message, WindowRef theWindow, void *handlerRefCon, DragRef theDrag);
  248. typedef CALLBACK_API( OSErr , DragReceiveHandlerProcPtr )(WindowRef theWindow, void *handlerRefCon, DragRef theDrag);
  249. typedef STACK_UPP_TYPE(DragTrackingHandlerProcPtr)                 DragTrackingHandlerUPP;
  250. typedef STACK_UPP_TYPE(DragReceiveHandlerProcPtr)                 DragReceiveHandlerUPP;
  251. #if OPAQUE_UPP_TYPES
  252.     EXTERN_API(DragTrackingHandlerUPP)
  253.     NewDragTrackingHandlerUPP       (DragTrackingHandlerProcPtr userRoutine);
  254.  
  255.     EXTERN_API(DragReceiveHandlerUPP)
  256.     NewDragReceiveHandlerUPP       (DragReceiveHandlerProcPtr userRoutine);
  257.  
  258.     EXTERN_API(void)
  259.     DisposeDragTrackingHandlerUPP    (DragTrackingHandlerUPP userUPP);
  260.  
  261.     EXTERN_API(void)
  262.     DisposeDragReceiveHandlerUPP    (DragReceiveHandlerUPP    userUPP);
  263.  
  264.     EXTERN_API(OSErr)
  265.     InvokeDragTrackingHandlerUPP    (DragTrackingMessage    message,
  266.                                     WindowRef                theWindow,
  267.                                     void *                    handlerRefCon,
  268.                                     DragRef                    theDrag,
  269.                                     DragTrackingHandlerUPP    userUPP);
  270.  
  271.     EXTERN_API(OSErr)
  272.     InvokeDragReceiveHandlerUPP       (WindowRef                theWindow,
  273.                                     void *                    handlerRefCon,
  274.                                     DragRef                    theDrag,
  275.                                     DragReceiveHandlerUPP    userUPP);
  276.  
  277. #else
  278.     enum { uppDragTrackingHandlerProcInfo = 0x00003FA0 };             /* pascal 2_bytes Func(2_bytes, 4_bytes, 4_bytes, 4_bytes) */
  279.     enum { uppDragReceiveHandlerProcInfo = 0x00000FE0 };             /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes) */
  280.     #define NewDragTrackingHandlerUPP(userRoutine)                     (DragTrackingHandlerUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragTrackingHandlerProcInfo, GetCurrentArchitecture())
  281.     #define NewDragReceiveHandlerUPP(userRoutine)                     (DragReceiveHandlerUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragReceiveHandlerProcInfo, GetCurrentArchitecture())
  282.     #define DisposeDragTrackingHandlerUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  283.     #define DisposeDragReceiveHandlerUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  284.     #define InvokeDragTrackingHandlerUPP(message, theWindow, handlerRefCon, theDrag, userUPP)  (OSErr)CALL_FOUR_PARAMETER_UPP((userUPP), uppDragTrackingHandlerProcInfo, (message), (theWindow), (handlerRefCon), (theDrag))
  285.     #define InvokeDragReceiveHandlerUPP(theWindow, handlerRefCon, theDrag, userUPP)  (OSErr)CALL_THREE_PARAMETER_UPP((userUPP), uppDragReceiveHandlerProcInfo, (theWindow), (handlerRefCon), (theDrag))
  286. #endif
  287. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  288. #define NewDragTrackingHandlerProc(userRoutine)                 NewDragTrackingHandlerUPP(userRoutine)
  289. #define NewDragReceiveHandlerProc(userRoutine)                     NewDragReceiveHandlerUPP(userRoutine)
  290. #define CallDragTrackingHandlerProc(userRoutine, message, theWindow, handlerRefCon, theDrag) InvokeDragTrackingHandlerUPP(message, theWindow, handlerRefCon, theDrag, userRoutine)
  291. #define CallDragReceiveHandlerProc(userRoutine, theWindow, handlerRefCon, theDrag) InvokeDragReceiveHandlerUPP(theWindow, handlerRefCon, theDrag, userRoutine)
  292. /*
  293.   _________________________________________________________________________________________________________
  294.       
  295.    o APPLICATION-DEFINED ROUTINES
  296.   _________________________________________________________________________________________________________
  297. */
  298. typedef CALLBACK_API( OSErr , DragSendDataProcPtr )(FlavorType theType, void *dragSendRefCon, DragItemRef theItemRef, DragRef theDrag);
  299. typedef CALLBACK_API( OSErr , DragInputProcPtr )(Point *mouse, SInt16 *modifiers, void *dragInputRefCon, DragRef theDrag);
  300. typedef CALLBACK_API( OSErr , DragDrawingProcPtr )(DragRegionMessage message, RgnHandle showRegion, Point showOrigin, RgnHandle hideRegion, Point hideOrigin, void *dragDrawingRefCon, DragRef theDrag);
  301. typedef STACK_UPP_TYPE(DragSendDataProcPtr)                     DragSendDataUPP;
  302. typedef STACK_UPP_TYPE(DragInputProcPtr)                         DragInputUPP;
  303. typedef STACK_UPP_TYPE(DragDrawingProcPtr)                         DragDrawingUPP;
  304. #if OPAQUE_UPP_TYPES
  305.     EXTERN_API(DragSendDataUPP)
  306.     NewDragSendDataUPP               (DragSendDataProcPtr        userRoutine);
  307.  
  308.     EXTERN_API(DragInputUPP)
  309.     NewDragInputUPP                   (DragInputProcPtr        userRoutine);
  310.  
  311.     EXTERN_API(DragDrawingUPP)
  312.     NewDragDrawingUPP               (DragDrawingProcPtr        userRoutine);
  313.  
  314.     EXTERN_API(void)
  315.     DisposeDragSendDataUPP           (DragSendDataUPP            userUPP);
  316.  
  317.     EXTERN_API(void)
  318.     DisposeDragInputUPP               (DragInputUPP            userUPP);
  319.  
  320.     EXTERN_API(void)
  321.     DisposeDragDrawingUPP           (DragDrawingUPP            userUPP);
  322.  
  323.     EXTERN_API(OSErr)
  324.     InvokeDragSendDataUPP           (FlavorType                theType,
  325.                                     void *                    dragSendRefCon,
  326.                                     DragItemRef                theItemRef,
  327.                                     DragRef                    theDrag,
  328.                                     DragSendDataUPP            userUPP);
  329.  
  330.     EXTERN_API(OSErr)
  331.     InvokeDragInputUPP               (Point *                    mouse,
  332.                                     SInt16 *                modifiers,
  333.                                     void *                    dragInputRefCon,
  334.                                     DragRef                    theDrag,
  335.                                     DragInputUPP            userUPP);
  336.  
  337.     EXTERN_API(OSErr)
  338.     InvokeDragDrawingUPP           (DragRegionMessage        message,
  339.                                     RgnHandle                showRegion,
  340.                                     Point                    showOrigin,
  341.                                     RgnHandle                hideRegion,
  342.                                     Point                    hideOrigin,
  343.                                     void *                    dragDrawingRefCon,
  344.                                     DragRef                    theDrag,
  345.                                     DragDrawingUPP            userUPP);
  346.  
  347. #else
  348.     enum { uppDragSendDataProcInfo = 0x00003FE0 };                     /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  349.     enum { uppDragInputProcInfo = 0x00003FE0 };                     /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  350.     enum { uppDragDrawingProcInfo = 0x000FFFA0 };                     /* pascal 2_bytes Func(2_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  351.     #define NewDragSendDataUPP(userRoutine)                         (DragSendDataUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragSendDataProcInfo, GetCurrentArchitecture())
  352.     #define NewDragInputUPP(userRoutine)                             (DragInputUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragInputProcInfo, GetCurrentArchitecture())
  353.     #define NewDragDrawingUPP(userRoutine)                             (DragDrawingUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragDrawingProcInfo, GetCurrentArchitecture())
  354.     #define DisposeDragSendDataUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  355.     #define DisposeDragInputUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  356.     #define DisposeDragDrawingUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  357.     #define InvokeDragSendDataUPP(theType, dragSendRefCon, theItemRef, theDrag, userUPP)  (OSErr)CALL_FOUR_PARAMETER_UPP((userUPP), uppDragSendDataProcInfo, (theType), (dragSendRefCon), (theItemRef), (theDrag))
  358.     #define InvokeDragInputUPP(mouse, modifiers, dragInputRefCon, theDrag, userUPP)  (OSErr)CALL_FOUR_PARAMETER_UPP((userUPP), uppDragInputProcInfo, (mouse), (modifiers), (dragInputRefCon), (theDrag))
  359.     #define InvokeDragDrawingUPP(message, showRegion, showOrigin, hideRegion, hideOrigin, dragDrawingRefCon, theDrag, userUPP)  (OSErr)CALL_SEVEN_PARAMETER_UPP((userUPP), uppDragDrawingProcInfo, (message), (showRegion), (showOrigin), (hideRegion), (hideOrigin), (dragDrawingRefCon), (theDrag))
  360. #endif
  361. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  362. #define NewDragSendDataProc(userRoutine)                         NewDragSendDataUPP(userRoutine)
  363. #define NewDragInputProc(userRoutine)                             NewDragInputUPP(userRoutine)
  364. #define NewDragDrawingProc(userRoutine)                         NewDragDrawingUPP(userRoutine)
  365. #define CallDragSendDataProc(userRoutine, theType, dragSendRefCon, theItemRef, theDrag) InvokeDragSendDataUPP(theType, dragSendRefCon, theItemRef, theDrag, userRoutine)
  366. #define CallDragInputProc(userRoutine, mouse, modifiers, dragInputRefCon, theDrag) InvokeDragInputUPP(mouse, modifiers, dragInputRefCon, theDrag, userRoutine)
  367. #define CallDragDrawingProc(userRoutine, message, showRegion, showOrigin, hideRegion, hideOrigin, dragDrawingRefCon, theDrag) InvokeDragDrawingUPP(message, showRegion, showOrigin, hideRegion, hideOrigin, dragDrawingRefCon, theDrag, userRoutine)
  368. /*
  369.   _________________________________________________________________________________________________________
  370.       
  371.    o INSTALLING AND REMOVING HANDLERS API'S
  372.   _________________________________________________________________________________________________________
  373. */
  374.  
  375. EXTERN_API( OSErr )
  376. InstallTrackingHandler            (DragTrackingHandlerUPP  trackingHandler,
  377.                                  WindowRef                 theWindow,
  378.                                  void *                    handlerRefCon)                        TWOWORDINLINE(0x7001, 0xABED);
  379.  
  380. EXTERN_API( OSErr )
  381. InstallReceiveHandler            (DragReceiveHandlerUPP     receiveHandler,
  382.                                  WindowRef                 theWindow,
  383.                                  void *                    handlerRefCon)                        TWOWORDINLINE(0x7002, 0xABED);
  384.  
  385. EXTERN_API( OSErr )
  386. RemoveTrackingHandler            (DragTrackingHandlerUPP  trackingHandler,
  387.                                  WindowRef                 theWindow)                            TWOWORDINLINE(0x7003, 0xABED);
  388.  
  389. EXTERN_API( OSErr )
  390. RemoveReceiveHandler            (DragReceiveHandlerUPP     receiveHandler,
  391.                                  WindowRef                 theWindow)                            TWOWORDINLINE(0x7004, 0xABED);
  392.  
  393. /*
  394.   _________________________________________________________________________________________________________
  395.       
  396.    o CREATING & DISPOSING
  397.   _________________________________________________________________________________________________________
  398. */
  399.  
  400. EXTERN_API( OSErr )
  401. NewDrag                            (DragRef *                theDrag)                            TWOWORDINLINE(0x7005, 0xABED);
  402.  
  403. EXTERN_API( OSErr )
  404. DisposeDrag                        (DragRef                 theDrag)                            TWOWORDINLINE(0x7006, 0xABED);
  405.  
  406. /*
  407.   _________________________________________________________________________________________________________
  408.       
  409.    o ADDING DRAG ITEM FLAVORS
  410.   _________________________________________________________________________________________________________
  411. */
  412.  
  413. EXTERN_API( OSErr )
  414. AddDragItemFlavor                (DragRef                 theDrag,
  415.                                  DragItemRef             theItemRef,
  416.                                  FlavorType             theType,
  417.                                  const void *            dataPtr,
  418.                                  Size                     dataSize,
  419.                                  FlavorFlags             theFlags)                            TWOWORDINLINE(0x7007, 0xABED);
  420.  
  421. EXTERN_API( OSErr )
  422. SetDragItemFlavorData            (DragRef                 theDrag,
  423.                                  DragItemRef             theItemRef,
  424.                                  FlavorType             theType,
  425.                                  const void *            dataPtr,
  426.                                  Size                     dataSize,
  427.                                  UInt32                 dataOffset)                            TWOWORDINLINE(0x7009, 0xABED);
  428.  
  429. /*
  430.   _________________________________________________________________________________________________________
  431.       
  432.    o PROVIDING CALLBACK PROCEDURES
  433.   _________________________________________________________________________________________________________
  434. */
  435.  
  436. EXTERN_API( OSErr )
  437. SetDragSendProc                    (DragRef                 theDrag,
  438.                                  DragSendDataUPP         sendProc,
  439.                                  void *                    dragSendRefCon)                        TWOWORDINLINE(0x700A, 0xABED);
  440.  
  441.  
  442. EXTERN_API( OSErr )
  443. SetDragInputProc                (DragRef                 theDrag,
  444.                                  DragInputUPP             inputProc,
  445.                                  void *                    dragInputRefCon)                    TWOWORDINLINE(0x700B, 0xABED);
  446.  
  447. EXTERN_API( OSErr )
  448. SetDragDrawingProc                (DragRef                 theDrag,
  449.                                  DragDrawingUPP         drawingProc,
  450.                                  void *                    dragDrawingRefCon)                    TWOWORDINLINE(0x700C, 0xABED);
  451.  
  452. /*
  453.   _________________________________________________________________________________________________________
  454.       
  455.    o SETTING THE DRAG IMAGE
  456.   _________________________________________________________________________________________________________
  457. */
  458.  
  459. EXTERN_API( OSErr )
  460. SetDragImage                    (DragRef                 theDrag,
  461.                                  PixMapHandle             imagePixMap,
  462.                                  RgnHandle                 imageRgn,
  463.                                  Point                     imageOffsetPt,
  464.                                  DragImageFlags         theImageFlags)                        TWOWORDINLINE(0x7027, 0xABED);
  465.  
  466. /*
  467.   _________________________________________________________________________________________________________
  468.       
  469.    o ALTERING THE BEHAVIOR OF A DRAG
  470.   _________________________________________________________________________________________________________
  471. */
  472. EXTERN_API( OSErr )
  473. ChangeDragBehaviors                (DragRef                 theDrag,
  474.                                  DragBehaviors             inBehaviorsToSet,
  475.                                  DragBehaviors             inBehaviorsToClear)                    TWOWORDINLINE(0x7028, 0xABED);
  476.  
  477. /*
  478.   _________________________________________________________________________________________________________
  479.       
  480.    o PERFORMING A DRAG
  481.   _________________________________________________________________________________________________________
  482. */
  483. EXTERN_API( OSErr )
  484. TrackDrag                        (DragRef                 theDrag,
  485.                                  const EventRecord *    theEvent,
  486.                                  RgnHandle                 theRegion)                            TWOWORDINLINE(0x700D, 0xABED);
  487.  
  488. /*
  489.   _________________________________________________________________________________________________________
  490.       
  491.    o GETTING DRAG ITEM INFORMATION
  492.   _________________________________________________________________________________________________________
  493. */
  494. EXTERN_API( OSErr )
  495. CountDragItems                    (DragRef                 theDrag,
  496.                                  UInt16 *                numItems)                            TWOWORDINLINE(0x700E, 0xABED);
  497.  
  498. EXTERN_API( OSErr )
  499. GetDragItemReferenceNumber        (DragRef                 theDrag,
  500.                                  UInt16                 index,
  501.                                  DragItemRef *            theItemRef)                            TWOWORDINLINE(0x700F, 0xABED);
  502.  
  503. EXTERN_API( OSErr )
  504. CountDragItemFlavors            (DragRef                 theDrag,
  505.                                  DragItemRef             theItemRef,
  506.                                  UInt16 *                numFlavors)                            TWOWORDINLINE(0x7010, 0xABED);
  507.  
  508. EXTERN_API( OSErr )
  509. GetFlavorType                    (DragRef                 theDrag,
  510.                                  DragItemRef             theItemRef,
  511.                                  UInt16                 index,
  512.                                  FlavorType *            theType)                            TWOWORDINLINE(0x7011, 0xABED);
  513.  
  514. EXTERN_API( OSErr )
  515. GetFlavorFlags                    (DragRef                 theDrag,
  516.                                  DragItemRef             theItemRef,
  517.                                  FlavorType             theType,
  518.                                  FlavorFlags *            theFlags)                            TWOWORDINLINE(0x7012, 0xABED);
  519.  
  520. EXTERN_API( OSErr )
  521. GetFlavorDataSize                (DragRef                 theDrag,
  522.                                  DragItemRef             theItemRef,
  523.                                  FlavorType             theType,
  524.                                  Size *                    dataSize)                            TWOWORDINLINE(0x7013, 0xABED);
  525.  
  526. EXTERN_API( OSErr )
  527. GetFlavorData                    (DragRef                 theDrag,
  528.                                  DragItemRef             theItemRef,
  529.                                  FlavorType             theType,
  530.                                  void *                    dataPtr,
  531.                                  Size *                    dataSize,
  532.                                  UInt32                 dataOffset)                            TWOWORDINLINE(0x7014, 0xABED);
  533.  
  534. /*
  535.   _________________________________________________________________________________________________________
  536.       
  537.    o DRAG ITEM BOUNDS
  538.   _________________________________________________________________________________________________________
  539. */
  540.  
  541. EXTERN_API( OSErr )
  542. GetDragItemBounds                (DragRef                 theDrag,
  543.                                  DragItemRef             theItemRef,
  544.                                  Rect *                    itemBounds)                            TWOWORDINLINE(0x7015, 0xABED);
  545.  
  546. EXTERN_API( OSErr )
  547. SetDragItemBounds                (DragRef                 theDrag,
  548.                                  DragItemRef             theItemRef,
  549.                                  const Rect *            itemBounds)                            TWOWORDINLINE(0x7016, 0xABED);
  550.  
  551. /*
  552.   _________________________________________________________________________________________________________
  553.       
  554.    o DROP LOCATIONS
  555.   _________________________________________________________________________________________________________
  556. */
  557.  
  558. EXTERN_API( OSErr )
  559. GetDropLocation                    (DragRef                 theDrag,
  560.                                  AEDesc *                dropLocation)                        TWOWORDINLINE(0x7017, 0xABED);
  561.  
  562. EXTERN_API( OSErr )
  563. SetDropLocation                    (DragRef                 theDrag,
  564.                                  const AEDesc *            dropLocation)                        TWOWORDINLINE(0x7018, 0xABED);
  565.  
  566. /*
  567.   _________________________________________________________________________________________________________
  568.       
  569.    o GETTING INFORMATION ABOUT A DRAG
  570.   _________________________________________________________________________________________________________
  571. */
  572.  
  573. EXTERN_API( OSErr )
  574. GetDragAttributes                (DragRef                 theDrag,
  575.                                  DragAttributes *        flags)                                TWOWORDINLINE(0x7019, 0xABED);
  576.  
  577. EXTERN_API( OSErr )
  578. GetDragMouse                    (DragRef                 theDrag,
  579.                                  Point *                mouse,
  580.                                  Point *                globalPinnedMouse)                    TWOWORDINLINE(0x701A, 0xABED);
  581.  
  582. EXTERN_API( OSErr )
  583. SetDragMouse                    (DragRef                 theDrag,
  584.                                  Point                     globalPinnedMouse)                    TWOWORDINLINE(0x701B, 0xABED);
  585.  
  586. EXTERN_API( OSErr )
  587. GetDragOrigin                    (DragRef                 theDrag,
  588.                                  Point *                globalInitialMouse)                    TWOWORDINLINE(0x701C, 0xABED);
  589.  
  590. EXTERN_API( OSErr )
  591. GetDragModifiers                (DragRef                 theDrag,
  592.                                  SInt16 *                modifiers,
  593.                                  SInt16 *                mouseDownModifiers,
  594.                                  SInt16 *                mouseUpModifiers)                    TWOWORDINLINE(0x701D, 0xABED);
  595.  
  596. /*
  597.   _________________________________________________________________________________________________________
  598.       
  599.    o DRAG HIGHLIGHTING
  600.   _________________________________________________________________________________________________________
  601. */
  602.  
  603. EXTERN_API( OSErr )
  604. ShowDragHilite                    (DragRef                 theDrag,
  605.                                  RgnHandle                 hiliteFrame,
  606.                                  Boolean                 inside)                                TWOWORDINLINE(0x701E, 0xABED);
  607.  
  608. EXTERN_API( OSErr )
  609. HideDragHilite                    (DragRef                 theDrag)                            TWOWORDINLINE(0x701F, 0xABED);
  610.  
  611. EXTERN_API( OSErr )
  612. DragPreScroll                    (DragRef                 theDrag,
  613.                                  SInt16                 dH,
  614.                                  SInt16                 dV)                                    TWOWORDINLINE(0x7020, 0xABED);
  615.  
  616. EXTERN_API( OSErr )
  617. DragPostScroll                    (DragRef                 theDrag)                            TWOWORDINLINE(0x7021, 0xABED);
  618.  
  619. EXTERN_API( OSErr )
  620. UpdateDragHilite                (DragRef                 theDrag,
  621.                                  RgnHandle                 updateRgn)                            TWOWORDINLINE(0x7022, 0xABED);
  622.  
  623. EXTERN_API( OSErr )
  624. GetDragHiliteColor                (WindowRef                 window,
  625.                                  RGBColor *                color)                                TWOWORDINLINE(0x7026, 0xABED);
  626.  
  627.  
  628. /*
  629.   _________________________________________________________________________________________________________
  630.       
  631.    o UTILITIES
  632.   _________________________________________________________________________________________________________
  633. */
  634.  
  635.  
  636. EXTERN_API( Boolean )
  637. WaitMouseMoved                    (Point                     initialMouse)                        TWOWORDINLINE(0x7023, 0xABED);
  638.  
  639.  
  640. EXTERN_API( OSErr )
  641. ZoomRects                        (const Rect *            fromRect,
  642.                                  const Rect *            toRect,
  643.                                  SInt16                 zoomSteps,
  644.                                  ZoomAcceleration         acceleration)                        TWOWORDINLINE(0x7024, 0xABED);
  645.  
  646. EXTERN_API( OSErr )
  647. ZoomRegion                        (RgnHandle                 region,
  648.                                  Point                     zoomDistance,
  649.                                  SInt16                 zoomSteps,
  650.                                  ZoomAcceleration         acceleration)                        TWOWORDINLINE(0x7025, 0xABED);
  651.  
  652.  
  653. /*
  654.   _________________________________________________________________________________________________________
  655.    o OLD NAMES
  656.      These are provided for compatiblity with older source bases.  It is recommended to not use them since
  657.        they may removed from this interface file at any time.
  658.   _________________________________________________________________________________________________________
  659. */
  660.  
  661.  
  662. typedef DragRef                         DragReference;
  663. typedef DragItemRef                     ItemReference;
  664. #if OLDROUTINENAMES
  665. enum {
  666.     dragHasLeftSenderWindow        = kDragHasLeftSenderWindow,        /* drag has left the source window since TrackDrag */
  667.     dragInsideSenderApplication    = kDragInsideSenderApplication,    /* drag is occurring within the sender application */
  668.     dragInsideSenderWindow        = kDragInsideSenderWindow        /* drag is occurring within the sender window */
  669. };
  670.  
  671. enum {
  672.     dragTrackingEnterHandler    = kDragTrackingEnterHandler,    /* drag has entered handler */
  673.     dragTrackingEnterWindow        = kDragTrackingEnterWindow,        /* drag has entered window */
  674.     dragTrackingInWindow        = kDragTrackingInWindow,        /* drag is moving within window */
  675.     dragTrackingLeaveWindow        = kDragTrackingLeaveWindow,        /* drag has exited window */
  676.     dragTrackingLeaveHandler    = kDragTrackingLeaveHandler        /* drag has exited handler */
  677. };
  678.  
  679. enum {
  680.     dragRegionBegin                = kDragRegionBegin,                /* initialize drawing */
  681.     dragRegionDraw                = kDragRegionDraw,                /* draw drag feedback */
  682.     dragRegionHide                = kDragRegionHide,                /* hide drag feedback */
  683.     dragRegionIdle                = kDragRegionIdle,                /* drag feedback idle time */
  684.     dragRegionEnd                = kDragRegionEnd                /* end of drawing */
  685. };
  686.  
  687. enum {
  688.     zoomNoAcceleration            = kZoomNoAcceleration,            /* use linear interpolation */
  689.     zoomAccelerate                = kZoomAccelerate,                /* ramp up step size */
  690.     zoomDecelerate                = kZoomDecelerate                /* ramp down step size */
  691. };
  692.  
  693. enum {
  694.     kDragStandardImage            = kDragStandardTranslucency,    /* 65% image translucency (standard)*/
  695.     kDragDarkImage                = kDragDarkTranslucency,        /* 50% image translucency*/
  696.     kDragDarkerImage            = kDragDarkerTranslucency,        /* 25% image translucency*/
  697.     kDragOpaqueImage            = kDragOpaqueTranslucency        /* 0% image translucency (opaque)*/
  698. };
  699.  
  700. #endif  /* OLDROUTINENAMES */
  701.  
  702.  
  703. #if PRAGMA_STRUCT_ALIGN
  704.     #pragma options align=reset
  705. #elif PRAGMA_STRUCT_PACKPUSH
  706.     #pragma pack(pop)
  707. #elif PRAGMA_STRUCT_PACK
  708.     #pragma pack()
  709. #endif
  710.  
  711. #ifdef PRAGMA_IMPORT_OFF
  712. #pragma import off
  713. #elif PRAGMA_IMPORT
  714. #pragma import reset
  715. #endif
  716.  
  717. #ifdef __cplusplus
  718. }
  719. #endif
  720.  
  721. #endif /* __DRAG__ */
  722.  
  723.